/*
 * Menus.cpp
 *
 *  Created on: Apr 20, 2010
 *      Author: Kevin
 */

#include "Menus.h"

Users::Users() : username(" "), password(" "){}

Users::Users(string userName, string passWord) : username(userName), password(passWord){}

Users::~Users(){}

Admin::Admin(){}

Admin::Admin(string userName, string passWord) : Users(userName, passWord){}

Admin::~Admin(){}

void Users::MainMenu()
{
	int choice;
	enum Options{VIEWLIST = 1, PLAN, TOUR, QUIT};
	PrintSpacer();

	//DisplayMainMenu();
	cin >> choice;
	cin.ignore(100, '\n');

	while(choice != QUIT)
	{
		switch(Options(choice))
		{
		case VIEWLIST	:	cout << "Option not implemented yet.";
															break;
		case PLAN		:	PlanTripMenu();
									 break;
		case TOUR		:	TakeTripMenu();
									 break;
		default			:	cout << "The number entered is not one of the options. "
								 << "Use numbers listed please.";
		}
		PrintSpacer();
		cout << endl << endl;
		DisplayMainMenu();
		cin >> choice;
		cin.ignore(100, '\n');
	}
}

void Users::PlanTripMenu()
{
	int choice;
	enum Options{SHORTTRIP = 1, CUSTOMTRIP, MAINMENU};
	PrintSpacer();

	DisplayPlanTripMenu();
	cin >> choice;
	cin.ignore(100, '\n');

	while(choice != MAINMENU)
	{
		switch(Options(choice))
		{
		case SHORTTRIP	:	ShortestTripMenu();
										 break;
		case CUSTOMTRIP	:	  CustomTripMenu();
										 break;
		default			:	cout << "The number entered is not one of the options. "
								 << "Use numbers listed please.";
		}
		PrintSpacer();
		cout << endl << endl;
		DisplayPlanTripMenu();
		cin >> choice;
		cin.ignore(100, '\n');
	}
	cout << endl << endl;
	/*DisplayPlanTripMenu();
	cin >> choice;
	cin.ignore(100, '\n');*/

}

void Users::ShortestTripMenu()
{
	int choice;
	enum Options{WINERYSTART = 1, NUMBEROFWINERIES, LISTOFWINERIES, MAINMENU};
	PrintSpacer();

	DisplayShortestTripMenu();
	cin >> choice;
	cin.ignore(100, '\n');

	while(choice != MAINMENU)
	{
		switch(Options(choice))
		{
		case WINERYSTART			:	cout << "Option not implemented yet.";
																		break;
		case NUMBEROFWINERIES		:	cout << "Option not implemented yet.";
																		break;
		case LISTOFWINERIES			:	cout << "Option not implemented yet.";
																		break;
		default			:	cout << "The number entered is not one of the options. "
								 << "Use numbers listed please.";
		}
		PrintSpacer();
		cout << endl << endl;
		DisplayShortestTripMenu();
		cin >> choice;
		cin.ignore(100, '\n');
	}
}

void Users::CustomTripMenu()
{
	int choice;
	enum Options{SELECTWINERIES = 1, PLANTRIP, MAINMENU};
	PrintSpacer();

	DisplayCustomTripMenu();
	cin >> choice;
	cin.ignore(100, '\n');

	while(choice != MAINMENU)
	{
		switch(Options(choice))
		{
		case SELECTWINERIES	:	cout << "Option not implemented yet.";
																break;
		case PLANTRIP		:	cout << "Option not implemented yet.";
																break;
		default				:	cout << "The number entered is not one of the options. "
									 << "Use numbers listed please.";
		}
		PrintSpacer();
		cout << endl << endl;
		DisplayCustomTripMenu();
		cin >> choice;
		cin.ignore(100, '\n');
	}
}

void Users::TakeTripMenu()
{
	int choice;
	enum Options{ENTERWINERY = 1, NEXTWINERY, TRIPINFO};
	PrintSpacer();

	DisplayTakeTripMenu();
	cin >> choice;
	cin.ignore(100, '\n');

	//this menu should repeat itself until the user is back at the villa - KZ
	switch(Options(choice))
	{
	case ENTERWINERY	:	cout << "Option not implemented yet.";
															break;
	case NEXTWINERY		:	cout << "Option not implemented yet.";
															break;
	case TRIPINFO		:	cout << "Option not implemented yet.";
															break;
	default				:	cout << "The number entered is not one of the options. "
								 << "Use numbers listed please.";
	}
	PrintSpacer();
	cout << endl << endl;
	DisplayTakeTripMenu();
	cin >> choice;
	cin.ignore(100, '\n');

}

void Users::WineryMenu()
{
	int choice;
	enum Options{SELECTWINE = 1, BUYWINE, EXITWINERY};
	PrintSpacer();

	DisplayWineryMenu();
	cin >> choice;
	cin.ignore(100, '\n');

	while(choice != EXITWINERY)
	{
		switch(Options(choice))
		{
		case SELECTWINE		:	cout << "Option not implemented yet.";
																break;
		case BUYWINE		:	cout << "Option not implemented yet.";
																break;
		default				:	cout << "The number entered is not one of the options. "
									 << "Use numbers listed please.";
		}
		PrintSpacer();
		cout << endl << endl;
		DisplayWineryMenu();
		cin >> choice;
		cin.ignore(100, '\n');
	}
}

void Users::VillaMenu()
{
	int choice;
	enum Options{TRIPINFO = 1, TOTALPURCHASED, MAINMENU};
	PrintSpacer();

	DisplayVillaMenu();
	cin >> choice;
	cin.ignore(100, '\n');

	while(choice != MAINMENU)
	{
		switch(Options(choice))
		{
		case TRIPINFO		:	cout << "Option not implemented yet.";
																break;
		case TOTALPURCHASED	:	cout << "Option not implemented yet.";
																break;
		default				:	cout << "The number entered is not one of the options. "
									 << "Use numbers listed please.";
		}
		PrintSpacer();
		cout << endl << endl;
		DisplayVillaMenu();
		cin >> choice;
		cin.ignore(100, '\n');
	}
}

void Users::DisplayMainMenu()
{
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl;
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(20) << " "
			<< "Straight Ahead Wine Tours" << setw(23) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(28) << " " << "Menu Options"
			<< setw(28) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(3) << " " << "1 - View List of Wineries";
	cout << setw(12) << " " << "2 - Plan your trip" << setw(10) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(10) << " " << "3 - Tour the Wineries";
	cout << setw(13) << " " << "4 - Quit" << setw(16) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl << endl;
	cout <<setw(5)<< " " << "PLEASE MAKE A MENU SELECTION: ";
}

void Users::DisplayPlanTripMenu()
{
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl;
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(28) << " " << "Plan Trip Menu"
			<< setw(26) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(3) << " " << "1 - Shortest Trip";
	cout << setw(12) << " " << "2 - Custom-made Trip" << setw(16) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(10) << " " << "3 - Return to Main Menu"
			<< setw(35) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl << endl;
	cout <<setw(5)<< " " << "PLEASE MAKE A MENU SELECTION: ";
}

void Users::DisplayShortestTripMenu()
{
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl;
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(28) << " " << "Shortest Trip Menu";
	cout << setw(22) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(3) << " " << "1 - Wineries to start with";
	cout << setw(4) << " " << "2 - Number of Wineries to visit" << setw(4) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(3) << " " << "3 - See list of Wineries";
	cout << setw(10) << " " << "4 - Return to Main Menu" << setw(8) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl << endl;
	cout <<setw(5)<< " " << "PLEASE MAKE A MENU SELECTION: ";
}

void Users::DisplayCustomTripMenu()
{
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl;
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(28) << " " << "Custom Trip Menu"
			<< setw(24) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(12) << " " << "1 - Select Wineries";
	cout << setw(8) << " " << "2 - Plan Trip" << setw(16) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(16) << " " << "3 - Return to Main Menu";
	cout << setw(29) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl << endl;
	cout <<setw(5)<< " " << "PLEASE MAKE A MENU SELECTION: ";
}

void Users::DisplayTakeTripMenu()
{
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl;
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(28) << " " << "Tour Wineries Menu"
			<< setw(24) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(12) << " " << "1 - Enter Winery";
	cout << setw(8) << " " << "2 - Move to next Winery" << setw(16) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(16) << " " << "3 - Current Trip Info";
	cout << setw(29) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl << endl;
	cout <<setw(5)<< " " << "PLEASE MAKE A MENU SELECTION: ";
}

void Users::DisplayWineryMenu()
{
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl;
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(28) << " " << "The Winery Menu"
			<< setw(24) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(12) << " " << "1 - Browse/Select Wine";
	cout << setw(8) << " " << "2 - Purchase Wine" << setw(16) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(16) << " " << "3 - Exit Winery";
	cout << setw(29) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl << endl;
	cout <<setw(5)<< " " << "PLEASE MAKE A MENU SELECTION: ";
}

void Users::DisplayVillaMenu()
{
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl;
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(28) << " " << "The Villa Menu"
			<< setw(24) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(12) << " " << "1 - Trip Info";
	cout << setw(8) << " " << "2 - Total Purchased in $$$" << setw(16) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(16) << " " << "3 - Return to Main Menu";
	cout << setw(29) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl << endl;
	cout <<setw(5)<< " " << "PLEASE MAKE A MENU SELECTION: ";
}

void Users::PrintSpacer()
{
	const int columns = 79;
	const char c = '-';
	int i;
	cout << endl;
	for (i = 0; i < columns; i++) {
		cout << c;
	}
	cout << endl << endl;
}

void Admin::MainMenu()
{
	int choice;
	enum Options{VIEWLIST = 1, PLAN, TOUR, FILES, QUIT};
	PrintSpacer();

	//DisplayMainMenu();
	cin >> choice;
	cin.ignore(100, '\n');

	while(choice != QUIT)
	{
		switch(Options(choice))
		{
		case VIEWLIST	:	cout << "Option not implemented yet.";
															break;
		case PLAN		:	PlanTripMenu();
									 break;
		case TOUR		:	TakeTripMenu();
									 break;
		case FILES		:	cout << "Option not implemented yet.";
															break;
		default			:	cout << "The number entered is not one of the options. "
								 << "Use numbers listed please.";
		}
		PrintSpacer();
		cout << endl << endl;
		DisplayMainMenu();
		cin >> choice;
		cin.ignore(100, '\n');
	}

}

void Admin::DisplayMainMenu()
{
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl;
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(20) << " "
			<< "Straight Ahead Wine Tours" << setw(23) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(28) << " " << "Menu Options"
			<< setw(28) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(3) << " " << "1 - View List of Wineries";
	cout << setw(12) << " " << "2 - Plan your trip" << setw(10) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(3) << " " << "3 - Tour the Wineries";
	cout << setw(16) << " " << "4 - File Maintenance" << setw(8) << " "
			<< "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(68) << " " << "*\n";
	cout << setw(6) << "*" << setw(22) << " " << "5 - Quit"
			<< setw(38) << " " << "*\n";
	cout << setw(6);
	for(int i = 0; i < 70; i++)
	{
		cout << "*";
	}
	cout << endl << endl;
	cout <<setw(5)<< " " << "PLEASE MAKE A MENU SELECTION: ";
}

void Menus(Users& theUser)
{
	theUser.DisplayMainMenu();
	theUser.MainMenu();
}

